package com.emergency.direct.controller;

import com.emergency.direct.service.WovenService;
import com.emergency.base.domain.Woven;
import com.emergency.common.entity.Result;
import com.emergency.common.entity.StatusCode;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by lijie on 2019/10/21.
 */
@RestController
@RequestMapping("/material")
@Api(value="编成类",description = "分队编辑类，包含分队信息、分队装备信息")
public class WovenController {
    @Autowired
    private WovenService wovenService;

    @ApiOperation(value = "分队增加接口" ,  notes="分队增加")
    @RequestMapping(value = "info/add",method = RequestMethod.POST)
    public Result add(@RequestBody Woven woven){
        wovenService.add();
        return new Result(true, StatusCode.OK,  "操作成功", "");
    }

    @ApiOperation(value = "分队修改接口" ,  notes="分队修改")
    @RequestMapping(value = "info/update",method = RequestMethod.POST)
    public Result update(@RequestBody Woven woven){
        wovenService.update();
        return new Result(true, StatusCode.OK,  "操作成功", "");
    }

    @ApiOperation(value = "分队删除接口" ,  notes="分队删除")
    @RequestMapping(value = "info/delete",method = RequestMethod.POST)
    public Result delete(long id){
        wovenService.delete();
        return new Result(true, StatusCode.OK,  "操作成功", "");
    }

    @ApiOperation(value = "分队信息获取接口" ,  notes="分队信息获取")
    @RequestMapping(value = "info/get",method = RequestMethod.POST)
    public Result get(){
        wovenService.get();
        return new Result(true, StatusCode.OK,  "操作成功", "");
    }

}
